/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Loading.java
 *
 * Created on 06.07.2010, 14:41:44
 */
package ru.ibrae.mchs.radiation.GUI;

import java.awt.Frame;
import javax.swing.JDialog;

/**
 *
 * @author murr
 */
public  class Loading extends JDialog {

    /** Creates new form Loading */
    public Loading(Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        setModal(Boolean.FALSE);
        setLocationByPlatform(true);
        //setText("Подождаите, идет загрузка");
        setVisible(true);
        this.setLocationRelativeTo(parent);
        jXBusyLabel1.updateUI();
    }

    public void setText(String text) {
        jXBusyLabel1.setText(text);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jXBusyLabel1 = new org.jdesktop.swingx.JXBusyLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setModal(true);
        setResizable(false);

        jXBusyLabel1.setBusy(true);
        jXBusyLabel1.setText("Подождите, пожалуйста, идет загрузка");
        jXBusyLabel1.setDoubleBuffered(true);
        jXBusyLabel1.setFocusable(false);
        jXBusyLabel1.setIconTextGap(10);
        jXBusyLabel1.setInheritsPopupMenu(false);
        jXBusyLabel1.setName("jXBusyLabel1"); // NOI18N
        jXBusyLabel1.setOpaque(true);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXBusyLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXBusyLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                Loading dialog = new Loading(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXBusyLabel jXBusyLabel1;
    // End of variables declaration//GEN-END:variables

    void close() {
        setVisible(false);
        dispose();
    }
}
